Florian Müllner [Thu, 8 Jun 2017 15:07:56 +0000 (17:07 +0200)]
layout: Make the hot corner optional
Whether people love or hate the hot corner depends in large extents
on hardware sensitivity and habits, which is hard to get right
universally. So bite the bullet and support an option to enable or
disable hot corners ...
Due to changes introduced in 5357e0a1 cursor recording interaction with
magnifier was reversed. This fix restores original correct behavior
Related issue: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1208
endSessionDialog: Check for PackageKit before considering updates/upgrades
GNOME Shell is spitting out some errors in the journal due to its attempts
to speak to PackageKit, which is not present on Endless OS, so let's add
some runtime checks to make sure that PackageKit is actually available
before assuming so and using its proxy to decide which kind of UI to
show to the user when ending the session.
Mutter now passes a ClutterInputDevice. And use this to pass the
device ID (as we used to do) and the event node (so we can transition
to something that works on x11/wayland)
Florian Müllner [Wed, 1 May 2019 10:34:00 +0000 (12:34 +0200)]
st: Consider non-background properties for ::style-changed
st_theme_node_paint_equal() was originally added to preserve paint state
when a style change didn't affect any of StWidget's cached background
resources.
That's why using it for filtering out unneeded style changes as in commit f662864a misses any non-background related properties that are relevant
for subclasses. Add additional tests to make sure we keep emitting the
signal in those cases.
Florian Müllner [Thu, 2 May 2019 18:27:05 +0000 (20:27 +0200)]
st: Add st_icon_colors_equal()
This is a small convenience wrapper around clutter_color_equal()
for the different color components, which also handles the case
where one (or both) of the icon colors are %NULL.
The first parameter to Object.assign() is the same target object that
will be returned. That is, since commit 46874eed0 Params.parse() modifies
the @defaults object. Usually we pass that parameter as an object literal
and this isn't an issue, but the change breaks spectacularly in the few
cases where we use a re-usable variable.
Restore the previous behavior by copying the object first.
Commit 46874eed0 accidentally changed the behavior of the function in
an incompatible way. Before addressing the actual issue, add a reproducer
to the unit tests to hopefully prevent future breakage.
Florian Müllner [Wed, 30 Jan 2019 00:18:24 +0000 (01:18 +0100)]
cleanup: Prefer template strings
Template strings are much nicer than string concatenation, so use
them where possible; this excludes translatable strings and any
strings containing '/' (until we can depend on gettext >= 0.20[0]).
Standard javascript now has Object.assign() which is very similar to
Params.parse(), except that the latter by default disallows "extra"
parameters. We can still leverage the standard API by simply
implementing the error check, and then call out to Object.assign()
for the actual parameter merging.
Jonas Dreßler [Thu, 4 Jul 2019 15:33:06 +0000 (17:33 +0200)]
st/button: Ungrab device before calling st_button_release
Since priv->device gets set to NULL inside st_button_release, ungrab the
input device before calling st_button_release and avoid
clutter_input_device_ungrab failing with a critical error.
While at it, also remove the superfluous line resetting priv->device to
NULL and move the check for priv->grabbed into an elseif block since
there should be no case where StButton has both grabs at the same time.
- generate the OSK key colors from variables in _colors.scss without changing the design
- add hover and active colors for all key, not only letter keys
- use $button_radius for the OSK keys, buttons and entries (no value change for the latter)
Florian Müllner [Mon, 28 Jan 2019 00:42:00 +0000 (01:42 +0100)]
style: Stop using braces for single-line arrow functions
Braces are optional for single-line arrow functions, but there's a
subtle difference:
Without braces, the expression is implicitly used as return value; with
braces, the function returns nothing unless there's an explicit return.
We currently reflect that in our style by only omitting braces when the
function is expected to have a return value, but that's not very obvious,
not an important differentiation to make, and not easy to express in an
automatic rule.
So just omit braces consistently as mandated by gjs' coding style.
Florian Müllner [Tue, 29 Jan 2019 19:36:54 +0000 (20:36 +0100)]
style: Fix indentation errors
While we have some style inconsistencies - mostly regarding split lines,
i.e. aligning to the first arguments vs. a four-space indent - there are
a couple of places where the spacing is simply wrong. Fix those.
Florian Müllner [Sat, 29 Jun 2019 15:37:59 +0000 (17:37 +0200)]
cleanup: Use arrow functions for tweener callbacks
While it is legal to use method syntax for the function properties
here, arrow notation is less unexpected and allows us to drop the
separate scope properties.
Florian Müllner [Fri, 1 Feb 2019 12:21:00 +0000 (13:21 +0100)]
cleanup: Use consistent switch indentation
We are currently inconsistent on whether case labels share the same
indentation level as the corresponding switch statement or not. gjs
goes with the default of no additional indentation, so go along with
that.
Florian Müllner [Mon, 4 Feb 2019 12:28:22 +0000 (13:28 +0100)]
systemActions: Reindent action map
Starting an object literal with a comment throws off eslint's rules
for brace style (newline between brace and properties for both opening
and closing brace or neither) as well as indentation (fixed four-space
indent or align with the previous argument).
Florian Müllner [Tue, 12 Feb 2019 14:16:08 +0000 (15:16 +0100)]
extensionPrefs: Avoid awkward indentation in string literal
The current code is carefully avoiding an overly wide line length as
well as adding literal new lines to the string due to indentation. It's
clever and barely legible.
Instead, use one string per line similar to how they appear in the actual
output, and join them together when setting the clipboard text.
Jonas Dreßler [Sun, 14 Apr 2019 16:32:37 +0000 (18:32 +0200)]
st: Replace global grabs with input device grabs
Global grabs are being removed from Clutter in favour of input device
grabs, so only grab the input device instead and replace priv->grabbed
with checks for priv->grab_device.
Florian Müllner [Tue, 29 Jan 2019 19:20:09 +0000 (20:20 +0100)]
style: Avoid trailing commas in array destructuring
When destructuring multiple return values, we often use trailing commas
to indicate that there are additional elements that we are ignoring.
There isn't anything inherently wrong with that, but it's a style that's
too confusing for eslint - on the one hand we require a space after a
comma, on the other hand we require no space before closing brackets.
Florian Müllner [Tue, 29 Jan 2019 01:26:39 +0000 (02:26 +0100)]
style: Use space after catch
We are currently inconsistent with whether or not to put a space
after catch clauses. While the predominant style is to omit it,
that's inconsistent with the style we use for any other statement.
There's not really a good reason to stick with it, so switch to
the style gjs/eslint default to.
Florian Müllner [Tue, 29 Jan 2019 23:22:10 +0000 (00:22 +0100)]
cleanup: Avoid variable declarations in case clauses
While allowed by the syntax, they are problematic because the
variable is in the scope of the switch() statement, but only
valid if a particular case clause is reached.
Add braces to limit the variables' scope to the corresponding
case clause to avoid that problem.
Florian Müllner [Tue, 29 Jan 2019 23:01:21 +0000 (00:01 +0100)]
cleanup: Avoid implicit coercion
Converting a variable to a particular type can be done explicitly (with
functions like Number() or toString()) or implicitly by relying on type
coercion (like concatenating a variable to the empty string to force
a string, or multiplying it with 1 to force a number).
As those tend to be less readable and clear, they are best avoided. So
replace the cases of string coercion we use with template strings, and
clarify the places that can be confused with number coercion.
Florian Müllner [Fri, 1 Feb 2019 13:36:37 +0000 (14:36 +0100)]
cleanup: Use rest operator to handle overly long argument lists
The existing indentation is bonkers, but there's no good replacement
with that many arguments. So switch to using the rest operator and
array destructuring as an alternative.
Florian Müllner [Sat, 29 Jun 2019 22:33:20 +0000 (00:33 +0200)]
keyboard: Remove unnecessary boolean cast
In contexts where a statement (like if or while) expects a condition,
any expression will be implicitly cast to boolean already without
C-isms like double negation.
Florian Müllner [Mon, 4 Feb 2019 12:22:41 +0000 (13:22 +0100)]
runDialog: Don't return from finally block
Control flow statements like return, break or continue are considered
unsafe in finally blocks, as they take precendence over any control
flow statement in the try and catch blocks, which may be unexpected.
This isn't the case here as the statement in the finally block is the
only one, but we can just as well avoid the finally block altogether
and use a regular return statement.
Jonas Dreßler [Thu, 20 Jun 2019 21:10:26 +0000 (23:10 +0200)]
altTab: Remove get_preferred_width override of AppIcon
This vfunc override has been introduced to ensure app icons are always
squared, but since the container of the AppIcon gets a square allocation
anyway if the 'square' property of the SwitcherButton is set, there's
no need to return a special width here.
Without the override we can also stop setting the size of the iconBin
manually. And since shell_app_create_icon_texture() uses logical pixels
but clutter_actor_set_size() uses screen pixels, that means we now no
longer set the size of the icon back to the unscaled value after it was
already correct.
Jonas Dreßler [Thu, 20 Jun 2019 21:01:52 +0000 (23:01 +0200)]
altTab: Ensure style of this._list before calculating icon sizes
We're calculating icon sizes for the alt tab switcher early and at a
point where the style attributes of this._list are not loaded yet. To
make sure the value of this._list.spacing is correct, call
ensure_style() on this._list before accessing the spacing.
Florian Müllner [Mon, 24 Jun 2019 21:26:41 +0000 (23:26 +0200)]
system: Drop custom styling of user submenu icon
The default style we get from .popup-menu-icon actually works better,
as it ensures consistency with all the other submenu icons used in
the aggregate menu.
Ray Strode [Thu, 27 Jun 2019 18:27:34 +0000 (14:27 -0400)]
animation: fix unintentional loop while polkit dialog is active
The polkit password dialog has a spinner that gets displayed
while the users password is being verified.
Unfortunately, the spinner stop method unintentionally calls
back into itself after the stop fade out animation is complete.
The stop method is called at startup, so the looping begins as
soon as the dialog is visible and continues until the dialog is
dismissed.
This commit fixes the loop by having the stop method cease
calling itself, and instead having it call the stop method on the
superclass.
Ray Strode [Thu, 27 Jun 2019 18:27:34 +0000 (14:27 -0400)]
animation: fix unintentional loop while polkit dialog is active
The polkit password dialog has a spinner that gets displayed
while the users password is being verified.
Unfortunately, the spinner stop method unintentionally calls
back into itself after the stop fade out animation is complete.
The stop method is called at startup, so the looping begins as
soon as the dialog is visible and continues until the dialog is
dismissed.
This commit fixes the loop by having the stop method cease
calling itself, and instead having it call the stop method on the
superclass.
Florian Müllner [Wed, 26 Jun 2019 17:51:18 +0000 (19:51 +0200)]
extensionDownloader: Use common message dialog layout
While the confirmation dialog for extension installation is simpler
than - say - authentication dialogs, it still makes sense to re-use
the common content layout instead of duplicating it.
Jonas Dreßler [Wed, 26 Jun 2019 16:06:28 +0000 (18:06 +0200)]
windowManager: Use own variables for each gesture
Using one variable to initialize all gestures will update the address of
the "gesture" pointer with every newly initialized object. This means
that event handlers which also use the "gesture" pointer like the
'keyboard-visible-changed' handler will update a different gesture as
soon as the pointer is changed.
This lead to a bug where the handler of 'keyboard-visible-changed'
wrongly nabled the unfullscreen gesture. Fix that by assigning each
gesture its own variable.
Niels De Graef [Thu, 20 Jun 2019 08:12:16 +0000 (10:12 +0200)]
Drop CoglError for GError
From https://gitlab.gnome.org/GNOME/mutter/merge_requests/631
```
CoglError was added at a certain point to remove the hard dependency on
GLib, but since this can't be avoided inside mutter, let's remove this
whole abstraction.
```
Florian Müllner [Tue, 18 Jun 2019 18:50:42 +0000 (20:50 +0200)]
iconGrid: Fix animation glitch
Since commit 520cea93941b, the opacity of icon grid children is used
both to skip children outside the current viewport and to hide the
real icons while animating icon clones.
As a result, a grid animation during an animation now ends up showing the
icons that are being animated. Avoid that glitch by leaving children's
opacity alone when there's an ongoing animation.
boxpointer: Don't trigger a relayout when updating arrow side
Changing the arrow side might need to reposition the boxpointer, however
if this happens during allocation, we don't need to trigger a new relayout since
we'd set the new allocation once _updateFlip's _reposition call is terminated,
otherwise if the position has changed, changing the boxpointer coordinates
will trigger a relayout anyways.
boxpointer: Don't set actor position during allocation
As per commit 044572cb60 boxpointer uses its own coordinates to position itself.
However this would lead to warning when mutter-clutter is compiled with debug
options as we'd might try to set the box coordinates during the allocation
cycle.
So, when calling _reposition during allocation, instead of setting the actor's
coordinates we just pass the allocation box and we adjust its origin, in order
to set it properly in the vfunc.
A boxpointer sourceActor could be destroyed before the boxpointer itself.
In such case, unset the sourceActor reference, connecting to 'destroy' signal.
Florian Müllner [Sat, 15 Jun 2019 12:48:58 +0000 (14:48 +0200)]
main: Use GLib's structured logging support
We still use our own copy of a libgsystem method for structured
logging, but since then GLib has gained (introspectable) API for
that functionality, so switch to that.
iconGrid: Don't hide children inside allocation loop
Hiding a child implies a parent reallocation, and IconGrid does it for the
children that doesn't fit in the available space, but this could lead to an
allocation recursion cycle. This has been introduced by commit 0e0574a0 to
reduce CPU usage not to using JS vfuncs.
To avoid this, toggle the children opacity instead so that we can achieve the
same visibility result, without any reallocation need.
In this way we also fix the case where hidden children can be shown again,
as _getVisibleChildren doesn't filter-out transparent ones, restoring the
pre-commit 0e0574a0 behavior.
Background is monitoring the whole `org.gnome.desktop.background` gsettings keys
for changes connecting to the non-specialized 'changed' signal and re-emitting
this as-is.
This means that when the background is changed via control-center, we get
multiple 'changed' signal events from GSettings, and for each one of this we
recreate a Background and a BackgroundActor.
Avoid this by using an idle to delay the emission of the 'changed' signal
grouping the events.
background: Use Garbage Collector to dispose background
The same Meta.Background could be used by multiple instances of background
actors, and so should not be disposed when the actor using it is destroyed.
Instead of calling `run_dispose` directly on it, just nullify the reference
on destroy method, leaving the job of doing the proper disposition to the
gabage collector that keeps the proper reference count on the Meta.Background.